

using System;
using System.Collections.Generic;
using System.Text;
using DataAccessLayer;
using EntityLayer;
using DataLayer;
using System.Data;
using InfraStructureLayer;

namespace BusinessLayer
{
	public class busPersonalInstruction:BusinessBase
	{
		public busPersonalInstruction() : base()
		{
		}
        public void SelectPersonalInstructionByLanguageId(entPersonalInstruction parEntPersonalInstruction)
        {
            try
            {
                datPersonalInstruction insDatPersonalInstruction = new datPersonalInstruction();
                DbConnector insDbConnector = new DbConnector();
                insDatPersonalInstruction.SelectPersonalInstructionByLanguageId(parEntPersonalInstruction, insDbConnector);
            }
            catch (SFException ex)
            {
                this.ErrorMessage = ex.Message;
            }
        }
        public void UpdatePersonalInstructionByLanguageId(entPersonalInstruction parEntPersonalInstruction)
		{
			
			datPersonalInstruction insDatPersonalInstruction=null;
			DbConnector insDbConnector = new DbConnector();
			try
			{
				insDatPersonalInstruction = new datPersonalInstruction();
                entPersonalInstruction insEntPersonalInstruction = new entPersonalInstruction();
                insEntPersonalInstruction.LanguageId = parEntPersonalInstruction.LanguageId;
                insDatPersonalInstruction.SelectPersonalInstructionByLanguageId(insEntPersonalInstruction, insDbConnector);
                if (insEntPersonalInstruction.PersonalInstructionId == 0)
                {
                    insDatPersonalInstruction.InsertPersonalInstruction(parEntPersonalInstruction, insDbConnector);
                }
                else
                {
                    insDatPersonalInstruction.UpdatePersonalInstructionByLanguageId(parEntPersonalInstruction, insDbConnector);
                }
			}
			catch (SFException ex)
			{
				this.ErrorMessage=ex.Message;
			}
		}
	
	}
}